package com.demo.swingquickticket.entity;

public enum SeatTypeContents {
    硬座("1"),
    软座("2"),
    硬卧("3"),
    软卧("4"),
    高级软卧("6"),
    商务座_特等座("9"),
    一等座("M"),
    二等座("O"),
    动卧("F");

    private String seatTypeCode;

    SeatTypeContents(String seatTypeCode) {
        this.seatTypeCode = seatTypeCode;
    }

    public String getSeatTypeCode() {
        return seatTypeCode;
    }

    public void setSeatTypeCode(String seatTypeCode) {
        this.seatTypeCode = seatTypeCode;
    }

    public static SeatTypeContents getInstance(String code) {
        for (SeatTypeContents temp : SeatTypeContents.values()) {
            if (temp.getSeatTypeCode().equals(code)) {
                return temp;
            }
        }
        return null;
    }
}
